/*
 * Copyright (c) 2024 iSOFT INFRASTRUCTURE SOFTWARE CO., LTD.
 * easyAda is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */

#ifndef CAP_MUTEX_H
#define CAP_MUTEX_H

#include <core/mutex.h>
#include <caps/capability.h>

static inline mutex_t *cap_mutex_get_obj(capability_t *cap)
{
    return (mutex_t *)cap_get_long_info(cap);
}

void cap_mutex_init(capability_t *cap, mutex_t *obj);

void cap_mutex_dispatcher(capability_t *cap, unsigned long tag, unsigned long m0, unsigned long m1, unsigned long m2,
                          unsigned long m3, unsigned long m4, unsigned long m5);

#endif
